<?php
/**
 * @author		João Batista Neto
 * @package		rpo
 * @subpackage	ssh\interfaces
 * @category	ssh, state
 */
namespace rpo\ssh\interfaces;

use rpo\base\String;

/**
 * Interface para um estado de conexão
 * @author		João Batista Neto
 * @package		rpo
 * @subpackage	ssh\interfaces
 * @category	ssh, state
 */
interface ISSHState {
	/**
	 * Autentica o usuário
	 * @param ISSHAuthentication $auth
	 * @param ISSHConnection $context
	 */
	public function authenticate( ISSHAuthentication $auth , ISSHConnection $context );

	/**
	 * Executa um comando no servidor remoto
	 * @param String $command
	 * @param ISSHConnection $context
	 */
	public function execute( String $command , ISSHConnection $context );

	/**
	 * Recupera a fingerprint do servidor
	 * @param ISSHConnection $context
	 * @return String
	 */
	public function getFingerprint( ISSHConnection $context );

	/**
	 * Abre uma nova conexão
	 * @param String $host
	 * @param integer $port
	 * @param ISSHConnection $context
	 */
	public function open( String $host , $port = 22 , ISSHConnection $context );

	/**
	 * Define o recurso da conexão
	 * @param resource $resource
	 */
	public function setResource( &$resource );
}